package com.tanhua.admin;

import com.tan.model.domain.Admin;
import com.tan.model.domain.Log;
import com.tanhua.admin.mapper.AdminMapper;
import com.tanhua.admin.mapper.LogMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.junit4.SpringRunner;

@SpringBootTest(classes = AdminServerApplication.class)
@RunWith(SpringRunner.class)
@Rollback(false)
public class test {
    @Autowired
    LogMapper logMapper;
    @Autowired
    AdminMapper adminMapper;
 @Test
    public void test(){
     Log log = new Log(1L, "login", "2020-06-01 12:00:00");
     logMapper.insert(log);
 }
    @Test
    public void test1(){
     Admin admin = new Admin();
     admin.setUsername("admin2");
     admin.setPassword("1234562");
     adminMapper.insert(admin);
    }
}
